import request from '../utils/request'

// 添加订单
export function addOrder (params) {
  return request.post('/order/addOrder',  params )
}

// 获取确认订单的信息
export function confirmOrder (params) {
  return request.get('/order/confirmOrder', { params })
}

// 地址列表，查看我有多少地址
export function addressList (params) {
  return request.get('/address/list', { params })
}

// 查询默认地址
export function defaultAddress (params) {
  return request.post('/address/defaultAddress', params )
}

//  添加订单的地址
export function addressAdd (params) {
 return request.post('/address/add', params )
}

//  修改订单的地址
export function updateOrderAddress (params) {
  return request.post('/order/updateOrderAddress', params )
}

//  更新地址接口
export function update (params) {
  return request.post('/address/update', params )
}

//  删除地址
export function deleteAddress (params) {
  return request.post('/address/delete', params)
}

//支付时删除购物车选中的数据
export function deleteCartItem (params) {
  return request.get('/order/deleteCartItem', { params })
}